<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<!-- 


    
 -->

<body>

    <script>
        var obj = {
            name: 'Tom',
            age: 10,
            speak: function(str1, str2, str3, str4) {
                console.log(this.name + '……' + (str1 + str2 + str3 + str4));
            }
        }
        console.log('obj');
        obj.speak();

        var obj2 = {
            name: 'Jack',
            age: 10
        };

        console.log('obj2');

        //从obj借一个speak函数给obj2
        //      obj.speak.call(obj2, 10, 20, 30, 40);
        obj.speak.apply(obj2, [10, 20, 30, 40]);
    </script>

</body>

</html>